<template>
    <div>
        <Row style="margin-top:20px">
            <Col span="19" class="table-form-input-select-col">
                <span class="alltitle"><router-link to="项目列表"> 项目列表</router-link>>预备员工专区>签到</span>
            </Col>
            <Col span="3" offset="1">
                <Button type="primary" @click="exportData">导出数据</Button>
            </Col>  
        </Row>
        <div class="content-div" style="margin-top:30px">
            <Table border stripe :columns="columns2" :data="data" ref="table"></Table>
        </div>
    </div>
</template>
<script>
import {
    formatDate
} from '@/js/date.js'
export default {
    data() {

            return {
                data: [],
                columns2: [
                {
                    title: "序号",
                    width: 99,
                    key: "id"
                }, 
                {
                    title: "姓名",
                    key: "name",
                },
                {
                    title: "电话",
                    key: "phone",
                },
                {
                    title: "积分",
                    key: "integral"
                },
                {
                    title: "签到天数",
                    key: "sign_count",
                },
                {
                    title: "领奖次数",
                    key: "award_count",
                }],
                showDataModalObject: {},
                data2: {},
            }
        },

        methods: {
            list() {
                var self = this;
                var poid = localStorage.pid;

                $.ajax({
                    url: "https://evp.51job.com/51job/api/1.0/index.php/minirs/user_ir/getSign",
                    data: {
                        "project_id": poid,
                    },
                    type: "POST",
                    dataType: "json",
                    success: function(data) {
                        console.log(data);
                        self.data = data.data;
                    }
                });
            },
            exportData() {
                this.$refs.table.exportCsv({
                    filename: "签到信息"
                });
            }
        },
        created() {
            var self = this;
            var poid = localStorage.pid;
            self.list();
        }
}
</script>
<style scoped>
.innertitle {
    line-height: 30px;
    font-size: 14px;
    text-decoration: underline;
    color: #4B80FD;
    font-family: MicrosoftYaHei;
    cursor: pointer;
}

.fazhanlicheng {
    box-sizing: border-box;
    background: #fff;
    margin-bottom: 1px;
    padding: 0px;
}

.title {
    font-size: 14px;
    color: #333333;
    letter-spacing: 0;
    line-height: 40px;
    font-weight: bold;
}

.inner-info2 {
    float: left;
    line-height: 60px;
    font-size: 14px;
    color: #333;
    font-family: MicrosoftYaHei;
    margin-right: 10px;
}

.time-picker {
    margin-top: 15px;
}

.add-new-progress {
    box-sizing: border-box;
    background: #fff;
    padding: 0;
    text-align: center;
    color: #4B80FD;
    font-family: SourceHanSansCN-Normal;
    font-size: 14px;
    line-height: 60px;
    cursor: pointer;
}

.img-border {
    border: 1px dashed #d9d9d9;
    background: #e5e5e5;
    display: block;
    width: 60px;
    text-align: center;
    height: 60px;
    line-height: 60px;
    font-size: 50px;
    cursor: pointer;
}

.banner {
    width: 60px;
    text-align: center;
    height: 60px;
}

.avatar-uploader-icon-banner {
    font-size: 28px;
    color: #8c939d;
    width: 167px;
    height: 84px;
    line-height: 84px;
    text-align: center;
    float: left;
    position: relative;
}
</style>
